<?php

function linkAt($to, $args, $htmlInner) {
  $argc = count($args);

  $out = "<a href=\"${to}";
  if( $argc > 0 ) {
    list( $key, $data ) = $args;
    $out .= '?'. htmlentities($key) .'='. urlencode(utf8_decode($data));
    foreach( $args as  $key => $data )  {
      $out .= '&amp;'. htmlentities($key) .'='. urlencode(utf8_decode($data));
    } 
  }

  $out .= "\">${htmlInner}</a>";

  return $out;
}

?>
